﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Util.Props
{

    /*
    @Documented
    @Target(ElementType.FIELD)
     */
    /// <summary>
    /// A string property.
    /// </summary>
    [S4Property]
    public class S4String: Attribute 
    {
       
        /// <summary>
        /// Default value to return
        /// </summary>
        public const String NOT_DEFINED = "nullnullnull";
        public String[] DEFAULT_RANGE = { };
        public S4String(String _vdefaultValue = NOT_DEFINED,String[] _vrange = null,Boolean _vmandatory=true)
        {
            // this default value will be mapped to zero by the configuration manager
            defaultValue = _vdefaultValue;
            range = _vrange;
            mandatory = _vmandatory;
        }

        private String _defaultValue = NOT_DEFINED;
        public String defaultValue
        {
            get{return _defaultValue;}
            set{_defaultValue = value;}
        }

        private String[] _range = {};
        public String[] range
        {
            get{return _range;}
            set{
                _range = value == null ? DEFAULT_RANGE : value;
            }
        }

        private Boolean _mandatory = true;
        public Boolean mandatory
        {
            get { return _mandatory; }
            set { _mandatory = value; }
        }

    }
}
